<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>AMD | js-signals unit test</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="lib/jasmine/jasmine.css">
        <script src="lib/jasmine/jasmine.js"></script>
        <script src="lib/jasmine/jasmine.async.js"></script>
        <script src="lib/jasmine/jasmine-html.js"></script>
        <script src="lib/require.js"></script>
    </head>
    <body>
        <script type="text/javascript" charset="utf-8">
            // we use a relative require to make sure signals isn't being
            // registered as a named module
            requirejs(['../dist/signals'], function(signals){
                if (window.signals) {
                  throw new Error('AMD module should not expose globals');
                }

                // expose global since specs expect a global var.
                window.signals = signals;

                // easier to do a nested require since specs aren't wrapped
                // into define calls.
                require(
                    [
                        "spec/add.spec",
                        "spec/dispatch.spec",
                        "spec/binding.spec",
                        "spec/remove.spec",
                        "spec/memorize.spec",
                        "spec/dispose.spec",
                        "spec/misc.spec"
                    ],
                    function(){
                        //run specs and add reporter
                        var reporter = new jasmine.HtmlReporter(),
                            env = jasmine.getEnv();
                        env.specFilter = function(spec){
                            return reporter.specFilter(spec)
                        };
                        env.addReporter(reporter);
                        env.execute();
                    }
                );
            });

        </script>
    </body>
</html>
